package com.mdd.front.controller;

import com.mdd.common.core.PageResult;
import com.mdd.front.service.staff.IStaffService;
import com.mdd.front.vo.staff.StaffDetailVo;
import com.mdd.front.vo.staff.StaffListVo;
import com.mdd.front.vo.staff.StaffPageParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 师傅管理
 */
@Api(tags = "师傅管理")
@RestController
@RequestMapping("api/staff")
public class StaffController {

    @Resource
    IStaffService iStaffService;

    /**
     * 师傅列表
     *
     * @param params 搜索参数
     * @return Object
     */
    @ApiOperation(value = "师傅管理 - 列表")
    @PostMapping("/list")
    public PageResult<StaffListVo> list(@RequestBody StaffPageParam params) {
        return iStaffService.list(params);
    }

    /**
     * 师傅详情
     *
     * @param id 主键    * @return Object
     */
    @ApiOperation(value = "师傅管理 - 师傅详情")
    @GetMapping("/detail")
    public StaffDetailVo detail(@RequestParam("id") Long id) {
        return iStaffService.detail(id);
    }
}
